package com.spring_mysql_redis.timing;

import com.spring_mysql_redis.mapper.MessageMapper;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.quartz.QuartzJobBean;

public class MsgTask extends QuartzJobBean {

    @Autowired
    private MessageMapper messageMapper;

    @Override
    protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {

        //将七天前的消息删除
        messageMapper.deleteDate();

    }
}
